<include file="public:header"/>
<load href="__TMPL__public/css/uc_v1.css" />   
<load href="__TMPL__/public/js/uc.js" />
<load href="__ROOT__/statics/css/formvalidator.css" />
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidator.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidatorregex.js"></script>

<div class="middle">
    <div class="uc clearfix account">
    	<div class="register">
         	<div id="reg_left">
            	<h2>新会员注册</h2>
                <div class="hint">加入{$site_name}，发现时尚，分享购物乐趣。</div>
                <form action="" method="post" id="myform">
                    <present name="err">
                    <div class="err" style="width:150px;">
                        <div class="icon_{$err.err}">{$err.msg}</div>                
                    </div>
                    </present>                  
                    <table style="margin:40px 0px 0px 30px;">
                        <tr>
                            <th><em class="red">*&nbsp;</em>登录帐号：</th>
                            <td><input type="text" class="input_text" id="name" name="name" value="{$data.name}"/></td>
                        </tr>
                        <tr>
                            <th><em class="red">*&nbsp;</em>电子邮箱：</th>
                            <td><input type="text" class="input_text" id="email" name="email" value="{$data.email}"/></td>
                        </tr>
                        <tr>
                            <th><em class="red">*&nbsp;</em>登录密码：</th>
                            <td><input type="password" class="input_text" name="passwd" id="passwd" value="{$data.passwd}"/></td>
                        </tr>
                        <tr>
                            <th><em class="red">*&nbsp;</em>确认密码：</th>
                            <td><input type="password" class="input_text" id="confirm_passwd"/></td>
                        </tr>
						<tr>
                            <th>性别：</th>
                            <td>
                            	<input type="radio" name="sex" value="0"/>男&nbsp;&nbsp;
                            	<input type="radio" name="sex" value="1"/>女&nbsp;&nbsp;
                                <input type="radio" name="sex" value="2" checked="checked"/>保密
                            </td>
                        </tr>                      
                        <tr>
                            <th><em class="red">*&nbsp;</em>验证码：</th>
                            <td>
                            	<input type="text" name="verify" id="verify" class="input_text left" maxlength=4 style="width:100px;"/>
                            	<img src="{:u('public/verify')}" class="verify_img" class="left"                              
								onclick="javascript:this.src='./?a=verify&m=public&tm='+Math.random()"
                                style="margin:5px 0px 0px 10px;"/>
								
                            </td>
                        </tr>
                        <tr>
                            <th></th>
                            <td>
                                <input name="dosubmit" type="submit" value=" " class="reg_btn"/>
                            </td>
                        </tr>
                    </table>
				</form>                
            </div>
            <div id="reg_right" class="login">
            	已有账号?请直接登录
                <a class="login_btn" href="{:u('uc/login')}"></a>
                <if condition="$seo.sina_app_key && $seo.qq_app_key">
                <p>您也可以用以下方式登录</p>
                <div class="login_list clearfix">
                    <neq name="seo.sina_app_key" value=""><a href="{:u('uc/sina_login')}" class="sina" target="_blank"></a></neq>
                    <neq name="seo.qq_app_key" value=""><a href="{:u('uc/qq_login')}" class="qq" target="_blank"></a></neq>
                </div>       
                </if>         
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
$(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true});
	
	$("#name").formValidator({
		onshow:"用户帐号不能为空",
		onfocus:"用户帐号不能为空",
		oncorrect:'此用户可以使用'
		}).inputValidator({
			min:2,max:50,onerror:"用户帐号长度不合法"
			}).ajaxValidator({
					datatype : "html",
					async : true,
					url : def.root+"index.php?m=uc&a=check_user",
					success : function(data){
						if(data==0){
							return true;
						}else if(data==1){
							return false;
						}
						else{
							return false;
						}
					},
		buttons: $("#button"),
		error: function(XMLHttpRequest, textStatus, errorThrown){alert("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
		onerror : "用户已存在，请更换用户名",
		onwait : "正在验证，请稍候..."
	});

	
	
	$("#email").formValidator({onshow:"请填写邮箱",onfocus:"邮箱不能为空",oncorrect:'此邮箱可以使用'}).inputValidator({min:1,onerror:"请填写邮箱"}).regexValidator({regexp:"email",datatype:"enum",onerror:"邮件格式错误"}).ajaxValidator({
		datatype : "html",
		async : true,
		url : def.root+"index.php?m=uc&a=check_email",
		success : function(data){
			if(data==0){
				return true;
			}else if(data==1){
				return false;
			}
			else{
				return false;
			}
		},		
		error: function(XMLHttpRequest, textStatus, errorThrown){alert("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
		onerror : "邮箱已存在，请更换邮箱",
		onwait : "正在验证，请稍候..."
	});
	
	$("#passwd").formValidator({onshow:"填写密码",onfocus:"填写6位以上密码"}).inputValidator({min:6,onerror:"请填写6位以上密码"});
	$("#confirm_passwd").formValidator({onshow:"确认密码",onfocus:"确认密码",oncorrect:"填写正确"}).inputValidator({min:6,onerror:"请填写确认密码"}).compareValidator({desid:"passwd",operateor:"=",onerror:"两次输入密码不一致"});
	/*
    $("#verify").formValidator({onshow:"请填写验证码",onfocus:"请填写验证码",oncorrect:'验证码正确'}).inputValidator({min:1,onerror:"请填写验证码"}).ajaxValidator({
		datatype : "html",
		async : true,
		url : def.root+"index.php?m=uc&a=check_code",
		success : function(data){
			if(data==0){
				return true;
			}else if(data==1){
				return false;
			}
			else{
				return false;
			}
		},	
		error: function(XMLHttpRequest, textStatus, errorThrown){alert("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
		onerror : "验证码不正确",
		onwait : "正在验证，请稍候..."
	});	*/
});
</script>
<include file="public:footer"/> 